home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: Favourites.dsrx 0.002 (01 Jun 2000)
- **
- ** © 2000 Andreas Mixich
- **
- ** PROGRAMNAME:
- ** Favourites.dsrx
- **
- ** FUNCTION:
- ** Macro for DirScanner. Reads in a list of specified paths.
- ** Set up as menu entry ! You can have different presets.
- ** Documents - Favourites.dsrx docs.lst
- ** Archives - Favourites.dsrx archives.lst
- ** and so on....
- ** Argument APPEND/S adds the new list to existing one without
- ** clearing paths list before
- **
- ** INSTALLATION:
- ** Modify the variable within this script:
- ** "defaultconfigpath" at line 68
- **
- ** Set up as ARexx-menu-entry in DirScanner Prefs.
- ** Example:
- **
- ** Name Path
- ** Find Archives rexx/favourites.dsrx arcs.lst
- ** Find Downloads rexx/favourites.dsrx downloads.lst
- ** Add Archives rexx/favourites.dsrx arcs.lst APPEND
- ** Add Downloads rexx/favourites.dsrx downloads.lst APPEND
- **
- ** The list, containing the paths must be like this:
- ** path1
- ** path2/directory/
- ** path3/directory
- ** No empty lines or multiple paths on one line are allowed.
- **
- ** TODO/BUGS: Find a way to trap RC > 0 It should work. Why does it not ?
- **
- **
- ** $HISTORY:
- **
- ** 01 Jun 2000 : 0.02 : added APPEND/S
- ** 01 Jun 2000 : 0.01 : initial release
- */
-
-
- /* ///------------------- "Init,ReadArgs,Setvars,AddLibs" -------------------- */
-
- /* enable support functions */
- OPTIONS RESULTS
- OPTIONS FAILAT 100
-
- SIGNAL ON ERROR
- SIGNAL ON FAILURE
- SIGNAL ON HALT
- SIGNAL ON BREAK_C
- SIGNAL ON SYNTAX
-
- /* define some usefull vars */
- TRUE = 1
- FALSE = 0
- LF = '*n' /* linefeed */
- appname = 'Favourites.dsrx' /* program's name */
- appversion = '$VER: Favourites.dsrx 0.001 (01 Jun 2000) Andreas Mixich <sp.amix@gmx.net>'
- appauthor = 'Andreas Mixich <sp.amix@gmx.net>'
- appcopyr = '© 2000 Andreas Mixich <sp.amix@gmx.net>'
- ArgsTemplate = "CONFIG/A,APPEND/S,PORTNAME/A"
- defconfigpath = "sys:tools/hdtools/dirscanner/rexx/lists/" /* modify to suite your needs */
-
- /* add the needed libraries */
- IF ~SHOW('LIBRARIES','rexxdossupport.library') THEN
- CALL ADDLIB('rexxdossupport.library',0,-30,0)
- IF ~SHOW('LIBRARIES','rexxsupport.library') THEN
- CALL ADDLIB('rexxsupport.library',0,-30,0)
-
-
- PARSE ARG argu
- IF ~ReadArgs(argu,ArgsTemplate,'argu.') THEN
- DO
- Call WriteLN(STDOUT,Fault(RC)||' '||appname)
- EXIT(10)
- END
-
- IF PathPart(argu.CONFIG) = "" THEN
- argu.CONFIG = AddPart(defconfigpath,argu.CONFIG)
-
- /*\\\*/
- /* ///-------------------------------- "Main" -------------------------------- */
-
- IF argu.PORTNAME = "" THEN argu.PORTNAME = "DIRSCANNER.1"
- address value argu.PORTNAME
-
- IF argu.APPEND ~= TRUE THEN
- 'CLEARPATHS'
-
- IF ~Open(c,argu.CONFIG,R) THEN
- DO
- 'REQUESTER "'||appname||LF||'Can not find list file\033nExiting"'
- EXIT
- END
- ELSE
- DO UNTIL EOF(c)
- line = ReadLN(c)
- IF line = "" THEN
- LEAVE
- 'ADDPATH '||line
- IF RC=20 THEN
- 'REQUESTER "Path '||line||' does not exist"'
- END
- EXIT
-
-
- /*\\\*/
- /* ///------------------------------- "Errors" ------------------------------- */
-
-
- /* BREAK_C */
- BREAK_C:
-
- txt = appname||' : ***BREAK'
- 'REQUESTER "'||txt||'"'
- EXIT
- RETURN
-
- /* ARexx HALT */
- HALT:
-
- txt = appname||' : HALTED'
- 'REQUESTER "'||txt||'"'
- EXIT
- RETURN
-
- /* Error */
- ERROR:
- SYNTAX:
- FAILURE:
-
- txt1 = appname||' : Error at line '||SIGL||': '||SourceLine(SIGL)
- txt2 = 'Error: '||RC||' '||ErrorText(RC)
- txt = txt1||LF||txt2
- 'REQUESTER "'||txt||'"'
- EXIT
- RETURN
-
- /*\\\*/
-
-